package com.kool.leitu.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.kool.leitu.annotation.KRequestAnnotation;
import com.kool.leitu.bean.SyErrorInfoBean;
import com.kool.leitu.base.bean.vo.PaginationVo;
import com.kool.leitu.base.bean.vo.PageResult;
import com.kool.leitu.service.ErrorCodeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @description: dao test
 * @author: tianhe
 * @create: 2018/10/23 00:43
 */
@Slf4j
@RestController
@Deprecated
public class DaoController {
    @Autowired
    private ErrorCodeService errorCodeService;

    @RequestMapping("/queryAut")
    @KRequestAnnotation("queryAut")
    public String queryAut() {
        JSONObject input = new JSONObject();
        input.put("aut_code", "CMAPPROV");

        SyErrorInfoBean syErrorInfoBean = new SyErrorInfoBean();
        PaginationVo pageInfo = new PaginationVo();
        pageInfo.setCurrentPage(1);
        pageInfo.setPageSize(20);

        PageResult pageResult = errorCodeService.queryPage(syErrorInfoBean, pageInfo);

        return JSON.toJSONString(pageResult);
    }
}
